package com.xiaochong.bitong.job.controller;

import com.xiaochong.bitong.job.service.KActionInitDataService;
import com.xiaochong.bitong.job.service.KActionSectionService;
import com.xiaochong.tir.common.data.hbasepo.TradesToKLine;
import com.xiaochong.tir.common.data.vo.ApiResultVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: k线各个维度初始化数据
 * @Author: org
 * @CreateDate: 2018/8/30 14:55
 */
@RestController
@RequestMapping(value = "/initData")
public class KActionInitDataController {

    @Autowired
    private KActionInitDataService kActionInitDataService;
    @Autowired
    private KActionSectionService kActionSectionService;
    /**
     * 5,15,30,1h，4h
     * @param KType
     * @return
     */
    @GetMapping("/kActionLongTime")
    public Object kActionLongTime(String KType) {
        return  kActionInitDataService.KActionInitData(KType);
    }

    /**
     * 日k，周k，月k，周k和月k依赖日k，先生成日k
     * @param KType
     * @param beginTime
     * @param endTime
     * @return
     */
    @GetMapping("/kActionLongTimeMaxPart")
    public Object kActionLongTimeNew(String KType,String beginTime,String endTime) {
        return  kActionInitDataService.kActionLongTimeNew(KType,beginTime,endTime);
    }

    /**
     * 5日资金流入初始化脚本
     * @return
     */
    @GetMapping("/flowMoneyFiveDay")
    public Object flowMoneyFiveDay(){
        kActionSectionService.calculateYesFlow();
        return  "success";
    }

    /**
     * hadax获取货币的平台币
     * @return
     */
    @GetMapping("/initExchangePingTaiB")
    public Object initExchangePingTaiB(){
        kActionSectionService.initExchangePingTaiB();
        return  "success";
    }
    /**
     * hadax获取货币的平台币
     * @return
     */
    @GetMapping("/initExchangePingTaiBParams")
    public Object initExchangePingTaiBParams(Integer start,Integer end){
        kActionSectionService.initExchangePingTaiB(start,end);
        return  "success";
    }
}
